package com.xizi.gson;

import com.google.gson.JsonArray;
import com.google.gson.JsonObject;

/**
 * @author xizizzz
 * @description: TODO
 * @date 2021-9-19上午 09:06
 */
public class Test {
    public static void main(String[] args) {
        JsonObject jsonObject = new JsonObject();
        jsonObject.addProperty("pId", 9527);
        jsonObject.addProperty("pName", "华安");
        jsonObject.addProperty("isMarry", true);
        jsonObject.add("child", new JsonArray());
        System.out.println(jsonObject);//{"pId":9527,"pName":"华安","isMarry":true,"child":[]}
    }
}
